package com.shop2cn.iapi.coupon.testcase;

import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.http.client.ClientProtocolException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Categories.IncludeCategory;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.coupon.parameter.ChooseCouponAutoBean;
import com.shop2cn.iapi.coupon.parameter.CouponInfo;
import com.shop2cn.iapi.coupon.parameter.OrderInfo;
import com.shop2cn.iapi.coupon.parameter.ProductInfo;
import com.shop2cn.iapi.coupon.parameter.SellerCoupons;
import com.shop2cn.iapi.coupon.parameter.SellerCouponsList;
import com.shop2cn.iapi.coupon.parameter.SellerOrderInfo;
import com.shop2cn.iapi.coupon.parameter.ShoppingInfo;
import com.shop2cn.iapi.coupon.service.ChooseCouponAutoCall;
import com.shop2cn.iapi.couponmanage.parameter.CreateCouponBean;
import com.shop2cn.iapi.couponmanage.parameter.SellerCreateBatchBean;
import com.ymatou.iapi.productmanager.parameter.product.AddSellerProductRequest;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymttest.business.service.CouponShop2cnMCallService;
import com.ymttest.business.service.LiveRoomCallService;
import com.ymttest.business.service.ProductManagerCallServiceV2;
import com.ymttest.database.model.LiveRoom;
import com.ymttest.database.model.YmtProducts;
import com.ymttest.database.sqlwapper.YmtProductsWapper;
import com.ymttest.database.sqlwapper.CouponShop2cn.couponWapper;
import com.ymttest.database.sqlwapper.CouponShop2cn.couponbatchWapper;
import com.ymttest.database.sqlwapper.CouponShop2cn.couponuseconditionWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 自动选择优惠券用例
 * FreeMaker Template自动生成代码
 * 
 * 逻辑：
 * 获取有效的买手优惠券
 * 
 * 
 */
@TestSuite 
public class Ts_ChooseCouponAuto {
    private static ChooseCouponAutoBean choosecouponautoBean;
    private static ChooseCouponAutoCall choosecouponautoCall;
	private couponbatchWapper couponbatchWapper=new couponbatchWapper();

    @BeforeClass
    public static void setUp() {
        Logger.createResultFile("自动选择优惠券用例");
    }

    @Before
    public void caseUp() {
        choosecouponautoBean = new ChooseCouponAutoBean();
        choosecouponautoCall = new ChooseCouponAutoCall();
    }

    @AfterClass
    public static void tearDown() {
        Logger.generateResult(choosecouponautoCall.getOpurl());
    }

    @After
    public void caseDown() {
        Logger.end();
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_001() {
        Logger.start(true, "自动选择优惠券-未指定商品");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));

           // ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);

            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            for(int i=0;i<1;i++)
            {
            choosecouponautoCall.callService();
            }

            verifyReturn(shoppingInfo);

        } catch (Exception e) {
            Logger.fail(e);
        }
    }

    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_001_1() {
        Logger.start(true, "自动选择优惠券-指定商品,并且购物车中包含指定商品");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
            
        	List<String> pIdStrings=new ArrayList();
			pIdStrings.add("p"+TestDataManager.getRandomIntNum(5));
            couponBatchBean.setproductIdList(pIdStrings);
            couponBatchBean.setUseConditionType(2);
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
            
            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);
            //新增
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
            shoppingInfo.getAllProducts().get(0).setProductCode(pIdStrings.get(0));
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            for(int i=0;i<1;i++)
            {
            choosecouponautoCall.callService();
            }

            verifyReturn(shoppingInfo);

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_001_2() {
        Logger.start(true, "自动选择优惠券-指定商品,但 购物车中不包含指定商品-最佳和可用买手优惠券返回空");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
            
        	List<String> pIdStrings=new ArrayList();
			pIdStrings.add("p"+TestDataManager.getRandomIntNum(5));
            couponBatchBean.setproductIdList(pIdStrings);
            
            couponBatchBean.setUseConditionType(2);
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
            
            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);
            //新增
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
            //shoppingInfo.getAllProducts().get(0).setProductCode(pIdStrings.get(0));
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            for(int i=0;i<1;i++)
            {
            choosecouponautoCall.callService();
            }

            verifyReturn(shoppingInfo);

            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
            for (SellerCoupons sellerCoupons : sellerCouponsList.getSellerCouponsList()) {
            	if(sellerCoupons.getSellerId()!=0){//买手券
	            	if(sellerCoupons.getBestCoupon()!=null)
	                 Logger.verifyEquals(null,sellerCoupons.getBestCoupon(), "验证商家最优优惠券为空");
	                 Logger.verifyEquals(true, isCouponContain(sellerCoupons.getUnusableCoupons(),shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), 
	                		 "验证商家不可用优惠券包含当前买手优惠券");
	                 Logger.verifyEquals(0, sellerCoupons.getUsableCoupons().size(),  "验证商家可用优惠券不包含当前买手优惠券");
            	}
            }
            
        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P2.class})
    @TestCase
    public void Tc_ChooseCouponAuto_002() {
        Logger.start(false, "自动选择优惠券-买手优惠券订单金额小于优惠券订单的不会选出来");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();	    
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(10000));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(9000));

            // 商家优惠券
			SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();

			couponBatchBean.setCouponAmount(new BigDecimal(9000));
            couponBatchBean.setOrderMinAmount(new BigDecimal(10000));
            
            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            choosecouponautoCall.callService();            

            verifyReturn(shoppingInfo);

            // 验证新创建的优惠券在不可用优惠券中
            List<CouponInfo> couponInfoList =
                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0).getUnusableCoupons();
            
            List<String> couponInfos = new ArrayList<>();

            for (CouponInfo couponInfo : couponInfoList) {
            	couponInfos.add(couponInfo.getCouponCode());
            }
            
            Logger.verifyEquals(true, couponInfos.contains(shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), "验证新创建的优惠券在不可用优惠券中");
        
        } catch (Exception e) {
            Logger.fail(e);
        }
    }

//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_003() {
//        Logger.start(false, "自动选择优惠券,使订单金额少于等于0的买手券不会被推荐出来，但是会出现在可用券里面");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
////			// 平台优惠券-链接
////			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
////			
////            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(1000));
////            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(990));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//			couponBatchBean.setCouponAmount(new BigDecimal(990));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(1000));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);
//
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            List<CouponInfo> UsableCoupons =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0).getUsableCoupons();
//
//            Logger.verifyEquals(null, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0).getBestCoupon(), "验证返回买手BestCoupon为空");
//
//            Logger.verifyEquals(true, isCouponContain(UsableCoupons, shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), "验证返回买手UsableCoupons包含新创建的优惠券");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }

//    @Test
//    @Category({P2.class})
//    @TestCase
//    public void Tc_ChooseCouponAuto_004() {
//        Logger.start(false, "自动选择优惠券,新用户中不会出现指定老用户券");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            // 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//          
//			createcouponBean.setUserType(2);
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(1000));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(990));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            List<CouponInfo> UsableCoupons =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//
//            Logger.verifyEquals(false, isCouponContain(UsableCoupons, shoppingInfo.getPlatformCouponCode()),
//                    "验证返回可用优惠券列表中没有该生成的老用户优惠券");
//
//            List<CouponInfo> UnUsableCoupons =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//
//            Logger.verifyEquals(false, isCouponContain(UnUsableCoupons, shoppingInfo.getPlatformCouponCode()),
//                    "验证返回不可用优惠券列表中没有该生成的老用户优惠券");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }

//    @Test
//    @Category({P2.class})
//    @TestCase
//    public void Tc_ChooseCouponAuto_005() {
//        Logger.start(false, "自动选择优惠券,老用户中不会出现指定新用户券");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            // 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.setUserType(1);
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(1000));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(990));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            shoppingInfo.getBuyerInfo().setBuyerOrderNum(2);
//
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            List<CouponInfo> UsableCoupons =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//
//            Logger.verifyEquals(false, isCouponContain(UsableCoupons, shoppingInfo.getPlatformCouponCode()),
//                    "验证返回可用优惠券列表中没有该生成的老用户优惠券");
//
//            List<CouponInfo> UnUsableCoupons =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//
//            Logger.verifyEquals(false, isCouponContain(UnUsableCoupons, shoppingInfo.getPlatformCouponCode()),
//                    "验证返回不可用优惠券列表中没有该生成的老用户优惠券");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }

    @Test
    @Category({P2.class})
    @TestCase
    public void Tc_ChooseCouponAuto_006() {
        Logger.start(false, "自动选择优惠券-商品活动指定不允许使用优惠券返回指定的错误代码-链接+商家优惠券");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

			// 平台优惠券-链接
			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		

			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));

            // 商家优惠券
			SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
			couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));

            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);

            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
                    .setIsNotAllowUseSellerCoupon(true);
            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
                    .setIsNotAllowUsePlatformCoupon(true);

            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            choosecouponautoCall.callService();

            Logger.verifyEquals("0", choosecouponautoCall.getStatusCode1(), "验证返回Code");
            Logger.verifyEquals("操作成功！",
                    choosecouponautoCall.getMessage(), "验证返回Message");

            Logger.verifyEquals(0, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0)
                    .getUsableCoupons().size(), "验证返回商家可用优惠券数为0");

            Logger.verifyEquals(0, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1)
                    .getUsableCoupons().size(), "验证返回平台可用优惠券数为0");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }

//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_007() {
//        Logger.start(false, "自动选择优惠券-商品活动指定不允许使用优惠券返回指定的错误代码-不允许平台优惠券");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(2));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//			couponBatchBean.setCouponAmount(new BigDecimal(1));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(2));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//                    .setIsNotAllowUsePlatformCoupon(true);
//
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            Logger.verifyEquals("0", choosecouponautoCall.getStatusCode1(), "验证返回Code");
//            Logger.verifyEquals("操作成功！",
//                    choosecouponautoCall.getMessage(), "验证返回Message");
//
//            Logger.verifyEquals(true, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0)
//                    .getUsableCoupons().size() > 0, "验证返回商家可用优惠券数大于0");
//
//            Logger.verifyEquals(0, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1)
//                    .getUsableCoupons().size(), "验证返回平台可用优惠券数为0");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }

    @Test
    @Category({P2.class})
    @TestCase
    public void Tc_ChooseCouponAuto_008() {
        Logger.start(true, "自动选择优惠券-商品活动指定不允许使用优惠券返回指定的错误代码-不允许商家优惠券");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
			couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));


            //ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, couponBatchBean);

            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
                    .setIsNotAllowUseSellerCoupon(true);

            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            choosecouponautoCall.callService();

            Logger.verifyEquals("0", choosecouponautoCall.getStatusCode1(), "验证返回Code");
            Logger.verifyEquals("操作成功！",
                    choosecouponautoCall.getMessage(), "验证返回Message");

            Logger.verifyEquals(0, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0)
                    .getUsableCoupons().size(), "验证返回商家可用优惠券数为0");

//            Logger.verifyEquals(true, choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1)
//                    .getUsableCoupons().size() > 0, "验证返回平台可用优惠券数大于0");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }

    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_009() {
        Logger.start(true, "自动选择优惠券-优惠券金额校验需要减去商品满减促销后的金额-RA-2339-优惠券订单金额小于优惠券订单的不会选出来");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

			// 平台优惠券-链接
			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		

            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(201));
            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
			couponBatchBean.setCouponAmount(new BigDecimal(20));
            couponBatchBean.setOrderMinAmount(new BigDecimal(201));


            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
            
            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
        		.setProductDiscountAmount(new BigDecimal(100));
            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
				.setProductPrice(new BigDecimal(300));
        
            choosecouponautoBean.setShoppingInfo(shoppingInfo);
           
            choosecouponautoCall.setData(choosecouponautoBean);
            choosecouponautoCall.callService();

            verifyReturn(shoppingInfo);

            // 验证新创建的平台优惠券在不可用优惠券中
            List<CouponInfo> couponInfoList =
                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
            
            List<String> couponInfos = new ArrayList<>();

            for (CouponInfo couponInfo : couponInfoList) {
            	couponInfos.add(couponInfo.getCouponCode());
            }
            
            Logger.verifyEquals(true, couponInfos.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在不可用优惠券中");
        
            // 验证新创建的商家优惠券在不可用优惠券中
            List<CouponInfo> couponInfoList2 =
                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(0).getUnusableCoupons();
            
            List<String> couponInfos2 = new ArrayList<>();

            for (CouponInfo couponInfo : couponInfoList2) {
            	couponInfos2.add(couponInfo.getCouponCode());
            }
            
            Logger.verifyEquals(true, couponInfos2.contains(shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), "验证新创建的优惠券在不可用优惠券中");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    

//	@Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_010() {
//        Logger.start(true, "自动选择优惠券-在商品分类中的优惠券会在可用优惠券中，JIRACONN-954");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(201));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> Categories = new ArrayList<Integer>();
//            Categories.add(33333);
//            Categories.add(22222);
//
//            createcouponBean.setCategories(Categories);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            List<String> Categories2 = new ArrayList<String>();
//            Categories2.add("22222");
//            Categories2.add("44444");
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//            	.setProductCategoryList(Categories2);
//            
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_011() {
//        Logger.start(false, "自动选择优惠券-不在商品分类中的优惠券会在可用优惠券中，JIRACONN-954");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(201));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> Categories = new ArrayList<Integer>();
//            Categories.add(33333);
//            Categories.add(22222);
//
//            createcouponBean.setCategories(Categories);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            List<String> Categories2 = new ArrayList<String>();
//            Categories2.add("5555");
//            Categories2.add("44444");
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//            	.setProductCategoryList(Categories2);
//        
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_012() {
//        Logger.start(true, "自动选择优惠券-在相应国家中的优惠券会在可用优惠券中，JIRACONN-3004");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(201));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> nums = new ArrayList<Integer>();
//            nums.add(33333);
//            nums.add(22222);
//
//            createcouponBean.setCountrys(nums);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//  				.setCountryId(22222);
//        
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_013() {
//        Logger.start(false, "自动选择优惠券-不在相应国家中的优惠券会在可用优惠券中，JIRACONN-3004");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(201));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> nums = new ArrayList<Integer>();
//            nums.add(33333);
//            nums.add(22222);
//
//            createcouponBean.setCountrys(nums);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//				.setCountryId(111);
//        
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_014() {
        Logger.start(true, "自动选择优惠券-优惠券面额从大到小");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

            int userId = TestDataManager.getRandomIntNum(6);
            ShoppingInfo shoppingInfo;

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(80));
//
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
            
            //couponBatchBean.setCurrency("USD");
            
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));

            String batchcode3 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode1 = couponCallService.receiveCouponInfo(batchcode3, userId).getUserReceiveResult().getCouponCode();
           
            couponBatchBean.setCouponAmount(new BigDecimal(12));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));

            String batchcode4 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode2 = couponCallService.receiveCouponInfo(batchcode4, userId).getUserReceiveResult().getCouponCode();
          
            shoppingInfo =
                        couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),null, sellerCouponCode2);
            
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            choosecouponautoCall.callService();
            
            verifyReturn(shoppingInfo);
            
            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
          
            Logger.verifyEquals(sellerCouponCode2, sellerCouponsList.getSellerCouponsList().get(0).getBestCoupon().getCouponCode(),"验证商家最优优惠券选择正确");
            //Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_015() {
        Logger.start(true, "自动选择优惠券-过期时间从小到大");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

            int userId = TestDataManager.getRandomIntNum(6);
            ShoppingInfo shoppingInfo;

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
			Date dNow = new Date(); // 当前时间
			Date dAfter = new Date();
			
			Calendar calendar2 = Calendar.getInstance(); // 得到日历
			calendar2.setTime(dNow);// 把当前时间赋给日历
			calendar2.add(Calendar.DAY_OF_MONTH, 10); // 设置为后十天
			dAfter = calendar2.getTime(); // 得到前一天的时间
//
//			createcouponBean.setValidEnd(dAfter);
//
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//            Calendar calendar3 = Calendar.getInstance(); // 得到日历
//			calendar3.setTime(dNow);// 把当前时间赋给日历
//			calendar3.add(Calendar.DAY_OF_MONTH, 15); // 设置为后十天
//			dAfter = calendar3.getTime(); // 得到前一天的时间
//
//			createcouponBean.setValidEnd(dAfter);
//			
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
            Calendar calendar4 = Calendar.getInstance(); // 得到日历
			calendar4.setTime(dNow);// 把当前时间赋给日历
			calendar4.add(Calendar.DAY_OF_MONTH, 15); // 设置为后十天
			dAfter = calendar4.getTime(); // 得到前一天的时间

			couponBatchBean.setEffectiveEndDate(dAfter);

            String batchcode3 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode1 = couponCallService.receiveCouponInfo(batchcode3, userId).getUserReceiveResult().getCouponCode();
           
            Calendar calendar5 = Calendar.getInstance(); // 得到日历
			calendar5.setTime(dNow);// 把当前时间赋给日历
			calendar5.add(Calendar.DAY_OF_MONTH, 8); // 设置为后十天
			dAfter = calendar5.getTime(); // 得到前一天的时间

			couponBatchBean.setEffectiveEndDate(dAfter);

            String batchcode4 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode2 = couponCallService.receiveCouponInfo(batchcode4, userId).getUserReceiveResult().getCouponCode();
          
//            shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),platformcouponCode2, sellerCouponCode2);
            
            shoppingInfo =
                    couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),null, sellerCouponCode2);
            
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            choosecouponautoCall.callService();
            
            verifyReturn(shoppingInfo);
            
            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
          
            Logger.verifyEquals(sellerCouponCode2, sellerCouponsList.getSellerCouponsList().get(0).getBestCoupon().getCouponCode(),"验证商家最优优惠券选择正确");
            //Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_016() {
        Logger.start(true, "自动选择优惠券-订单满足金额从大到小 ");
        try {
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

            int userId = TestDataManager.getRandomIntNum(6);
            ShoppingInfo shoppingInfo;

//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(110));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();

            // 商家优惠券
            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
			
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(20));

            String batchcode3 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode1 = couponCallService.receiveCouponInfo(batchcode3, userId).getUserReceiveResult().getCouponCode();
           
            couponBatchBean.setCouponAmount(new BigDecimal(10));
            couponBatchBean.setOrderMinAmount(new BigDecimal(22));

            String batchcode4 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            String sellerCouponCode2 = couponCallService.receiveCouponInfo(batchcode4, userId).getUserReceiveResult().getCouponCode();
          
            shoppingInfo =
                        couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),null, sellerCouponCode2);
            shoppingInfo.getAllProducts().get(0).setCurrency(couponBatchBean.getCurrency());
               
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            choosecouponautoCall.callService();
            
            verifyReturn(shoppingInfo);
            
            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
          
            Logger.verifyEquals(sellerCouponCode2, sellerCouponsList.getSellerCouponsList().get(0).getBestCoupon().getCouponCode(),"验证商家最优优惠券选择正确");
          //  Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_017() {
//        Logger.start(true, "自动选择优惠券-优选商品-普通商品 ");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            int userId = TestDataManager.getRandomIntNum(6);
//            ShoppingInfo shoppingInfo;
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//			createcouponBean.setIsLimitPspProduct(true);
//
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
//
//           shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId,33455,platformcouponCode2, null);
//               
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            choosecouponautoCall.callService();
//            
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//          
//            Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getUnusableCoupons().get(0).getCouponCode(),"验证平台最优优惠券选择正确");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_018() {
//        Logger.start(true, "自动选择优惠券-团长券 ");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            int userId = TestDataManager.getRandomIntNum(6);
//            ShoppingInfo shoppingInfo;
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//			createcouponBean.setIsLimitPspProduct(true);
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(30));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(21));
//
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
//
//           shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId,33455,platformcouponCode2, null);
//           //使用团长券
//           shoppingInfo.setCanUseGroupCoupon(true);
//           
//           shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setIsPsp(true);
//           
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            choosecouponautoCall.callService();
//            
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//          
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(0).getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(1).getCouponCode(),"验证平台最优优惠券选择正确");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_019() {
//        Logger.start(true, "自动选择优惠券-使用团长券-团长券金额大于普通券-推荐团长券金额-迭代业务");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            int userId = TestDataManager.getRandomIntNum(6);
//            ShoppingInfo shoppingInfo;
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();	
//			
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(30));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(21));
//            
//			createcouponBean.setIsLimitGroupSponsor(true);//使用团长券
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
//
//           shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId,33455,platformcouponCode2, null);
//           
//           shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setIsPsp(true);
//           
//           shoppingInfo.setCanUseGroupCoupon(true);//使用团长券
//           
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            choosecouponautoCall.callService();
//            
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//          
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(0).getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(1).getCouponCode(),"验证平台最优优惠券选择正确");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_020() {
//        Logger.start(true, "自动选择优惠券-使用团长券-团长券金额小于普通券-使用普通券-迭代业务");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//            int userId = TestDataManager.getRandomIntNum(6);
//            ShoppingInfo shoppingInfo;
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();	
//			createcouponBean.setIsLimitGroupSponsor(true);//使用团长券
//            String batchcode1 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode1 = couponCallService.receiveCouponInfo(batchcode1, userId).getUserReceiveResult().getCouponCode();
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(30));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(21));
//            
//			createcouponBean.setIsLimitGroupSponsor(false);//第二个优惠券设为不使用团长券
//            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//            String platformcouponCode2 = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
//
//           shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId,33455,platformcouponCode2, null);
//           
//           shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setIsPsp(true);
//           
//           shoppingInfo.setCanUseGroupCoupon(true);//使用团长券
//           
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            choosecouponautoCall.callService();
//            
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//          
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getBestCoupon().getCouponCode(),"验证平台最优优惠券选择正确");
//            Logger.verifyEquals(platformcouponCode2, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(0).getCouponCode(),"验证平台第1个当前购物车可用的优惠券列表选择正确");
//            Logger.verifyEquals(platformcouponCode1, sellerCouponsList.getSellerCouponsList().get(1).getUsableCoupons().get(1).getCouponCode(),"验证平台第1个当前购物车可用的优惠券列表选择正确");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
    
    
    
    @Test
    @Category({P1.class})
    @TestCase
    public void Tc_ChooseCouponAuto_021() {
        Logger.start(true, "自动选择优惠券-商家优惠券-JIRACONN-23166");
        try {
        	
        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
			// 商家优惠券-链接
        	 SellerCreateBatchBean sellerCreateBatchBean = couponCallService.setDefaultSellerCreateBatch_ActivityBean();		

            sellerCreateBatchBean.setCouponAmount(new BigDecimal(10));
            sellerCreateBatchBean.setOrderMinAmount(new BigDecimal(20));

            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(null, sellerCreateBatchBean);
            
            shoppingInfo.getAllProducts().get(0).setCurrency(sellerCreateBatchBean.getCurrency());
            
            choosecouponautoBean.setShoppingInfo(shoppingInfo);

            choosecouponautoCall.setData(choosecouponautoBean);
            
            for(int i=0;i<1;i++)
            {
             choosecouponautoCall.callService();
            }

            verifyReturn(shoppingInfo);
           

        } catch (Exception e) {
            Logger.fail(e);
        }
    }
    
    
    
    
//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_022() {
//        Logger.start(true, "自动选择优惠券-在相应国家中的优惠券会在可用优惠券中，JIRACONN-23167");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(2));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> nums = new ArrayList<Integer>();
//            nums.add(33333);
//            nums.add(22222);
//
//            createcouponBean.setBrands(nums);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//  				.setBrandId(22222);
//        
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    @Test
//    @Category({P2.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_023() {
//        Logger.start(false, "自动选择优惠券-不在相应国家中的优惠券会在可用优惠券中，JIRACONN-23167");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//            createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(2));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(1));
//            
//            List<Integer> nums = new ArrayList<Integer>();
//            nums.add(33333);
//            nums.add(22222);
//
//            createcouponBean.setCountrys(nums);
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, null);
//            
//            shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0)
//				.setBrandId(111);
//        
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            choosecouponautoCall.callService();
//
//            verifyReturn(shoppingInfo);
//
//            // 验证新创建的平台优惠券不在可用优惠券中
//            List<CouponInfo> couponInfoList1 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons();
//            
//            List<String> couponInfos1 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList1) {
//            	couponInfos1.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(false, couponInfos1.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券不在可用优惠券中");
//            
//            // 验证新创建的平台优惠券在不可用优惠券中
//            List<CouponInfo> couponInfoList2 =
//                    choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons();
//            
//            List<String> couponInfos2 = new ArrayList<>();
//
//            for (CouponInfo couponInfo : couponInfoList2) {
//            	couponInfos2.add(couponInfo.getCouponCode());
//            }
//            
//            Logger.verifyEquals(true, couponInfos2.contains(shoppingInfo.getPlatformCouponCode()), "验证新创建的优惠券在不可用优惠券中");
//        
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_024() {
//        Logger.start(true, "自动选择优惠券-分销");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//            couponBatchBean.setCouponAmount(new BigDecimal(10));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//            
//            Logger.comment("##############SetshoppingInfo 开始##########################");
//            int userId = Integer.parseInt(EnvSetup.getData("couponBuyerId"));
//            // 平台优惠券
//            String platformcouponCode = null;
//            if (createcouponBean != null)
//            {
//                // createcouponBean
//                String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
//                platformcouponCode = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
//            }
//
//            // 商家优惠券
//            String sellerCouponCode = null;
//            ShoppingInfo shoppingInfo;
//            if (couponBatchBean != null)
//            {
//                String batchCode1 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
//                //分销
//    			couponbatchWapper.setPlatformSource(1,batchCode1);
//                sellerCouponCode = couponCallService.receiveCouponInfo(batchCode1, userId).getUserReceiveResult().getCouponCode();
//           
//                shoppingInfo =
//                        couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),platformcouponCode, sellerCouponCode);
//                shoppingInfo.setPlatformSource(1);
//                
//            }
//            else {
//            	 shoppingInfo =
//                         couponCallService.setDefaultShoppingInfo(userId,platformcouponCode, sellerCouponCode);
//    		}
//            Logger.comment("##############SetshoppingInfo 结束##########################");
//			
//			
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_025() {
//        Logger.start(true, "自动选择优惠券-平台+商家，其中平台面额>普通商家优惠券平台仅直播是使用");
//        try {
//        	//创建直播商品
//		    int sellerId = Integer.parseInt(EnvSetup.getData("autotest_seller1"));
//			AddSellerProductRequest addpro = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
//			String pid = ProductManagerCallServiceV2.addNewProduct(addpro).get("Data").getAsJsonObject().get("ProductId").getAsString();
//			Logger.comment("创建商品：" + pid);
//			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(sellerId));
//			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
//			LiveRoomCallService.SellerLiveOnline(createlive.getId(), createlive.getUserId());
//			
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//			createcouponBean.setLimitLiveProduct(true);
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//            couponBatchBean.setCouponAmount(new BigDecimal(10));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//			//设置直播商品
//			YmtProducts product= new YmtProductsWapper().selectProductByProductId(pid);
//			shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setProductCode(pid);
//			shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setCategoryId(product.getIcategoryid());
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_026() {
//        Logger.start(true, "自动选择优惠券-平台+商家，其中平台面额<普通商家优惠券平台仅直播是使用");
//        try {
//        	//创建直播商品
//		    int sellerId = Integer.parseInt(EnvSetup.getData("autotest_seller1"));
//			AddSellerProductRequest addpro = ProductManagerCallServiceV2.initAddSellerProductRequest(sellerId);
//			String pid = ProductManagerCallServiceV2.addNewProduct(addpro).get("Data").getAsJsonObject().get("ProductId").getAsString();
//			Logger.comment("创建商品：" + pid);
//			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(sellerId));
//			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
//			LiveRoomCallService.SellerLiveOnline(createlive.getId(), createlive.getUserId());
//			
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//            couponBatchBean.setSellerId(sellerId);
//            couponBatchBean.setCouponType((byte)4);
//            couponBatchBean.setCouponAmount(new BigDecimal(15));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//			//设置直播商品
//			YmtProducts product= new YmtProductsWapper().selectProductByProductId(pid);
//			shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setProductCode(pid);
//			shoppingInfo.getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().get(0).setCategoryId(product.getIcategoryid());
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_027() {
//        Logger.start(true, "自动选择优惠券-平台+商家，商家是仅直播优惠券，直播优惠券在非直播商品中使用");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//            couponBatchBean.setCouponType((byte)4);
//            couponBatchBean.setCouponAmount(new BigDecimal(15));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//              choosecouponautoCall.callService();
//            }
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//            for (SellerCoupons sellerCoupons : sellerCouponsList.getSellerCouponsList()) {
//            	if(sellerCoupons.getSellerId()!=0){//商家券
//	            	if(sellerCoupons.getBestCoupon()!=null)
//	                 Logger.verifyEquals(true,sellerCoupons.getBestCoupon().getCouponCode()!=shoppingInfo.getSellerOrderInfos().get(0).getCouponCode(), 
//	                		 "验证商家最优优惠券包含直播优惠券");
//	                 Logger.verifyEquals(true, isCouponContain(sellerCoupons.getUnusableCoupons(),shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), 
//	                		 "验证商家不可用优惠券包含直播优惠券");
//	                 Logger.verifyEquals(false, isCouponContain(sellerCoupons.getUsableCoupons(),shoppingInfo.getSellerOrderInfos().get(0).getCouponCode()), 
//	                		 "验证商家可用优惠券不包含直播优惠券");
//            	}
//            }
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//   
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_028() {
//        Logger.start(true, "自动选择优惠券-平台+商家，平台优惠券是仅直播优惠券，直播优惠券在非直播商品中使用");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();
//			createcouponBean.setLimitLiveProduct(true);
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//            couponBatchBean.setCouponAmount(new BigDecimal(15));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//              choosecouponautoCall.callService();
//            }
//            verifyReturn(shoppingInfo);
//            
//            SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
//            for (SellerCoupons sellerCoupons : sellerCouponsList.getSellerCouponsList()) {
//            	if(sellerCoupons.getSellerId()==0){//平台券
//	            	if(sellerCoupons.getBestCoupon()!=null)
//	                 Logger.verifyEquals(true,sellerCoupons.getBestCoupon().getCouponCode()!=shoppingInfo.getPlatformCouponCode(), 
//	                		 "验证商家最优优惠券包含直播优惠券");
//	                 Logger.verifyEquals(true, isCouponContain(sellerCoupons.getUnusableCoupons(),shoppingInfo.getPlatformCouponCode()), 
//	                		 "验证商家不可用优惠券包含直播优惠券");
//	                 Logger.verifyEquals(false, isCouponContain(sellerCoupons.getUsableCoupons(),shoppingInfo.getPlatformCouponCode()), 
//	                		 "验证商家可用优惠券不包含直播优惠券");
//            	}
//            }
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_029() {
//        Logger.start(true, "自动选择优惠券-限优选会员-用户是会员（memberGrade=1)-JIRACONN-32779");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//        	createcouponBean.setuseConditionType(12);//12 限优选会员 13 限优选会员+商品
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//            couponBatchBean.setCouponAmount(new BigDecimal(10));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//            
//            shoppingInfo.getBuyerInfo().setMemberGrade(1);
//            
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_030() {
//        Logger.start(true, "自动选择优惠券--限优选会员+商品-用户是会员（memberGrade=1)-商品与优惠券指定的不商品一致-优惠券出现在不可用列表中-JIRACONN-32779");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//            String productCode=TestDataManager.getRandomNum(10);
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(100));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(90));
//        	createcouponBean.setuseConditionType(13);//12 限优选会员 13 限优选会员+商品
//        	
//		    List<String> list = new ArrayList<String>();
//            list.add(productCode);
//	        createcouponBean.setProductIds(list);
//	        Logger.comment("### productCode ### "+productCode);
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//            couponBatchBean.setCouponAmount(new BigDecimal(10));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//            
//            shoppingInfo.getBuyerInfo().setMemberGrade(1);
//            
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//
//            long count= choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUnusableCoupons().stream()
//            .filter(a->a.getCouponCode().equals(shoppingInfo.getPlatformCouponCode())).count();
//            Logger.comment("条数："+count);
//            Logger.verifyEquals(true, count==1, "商品与优惠券指定的不商品一致-优惠券出现在不可用列表中");
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
//    
//    
//    
//    @Test
//    @Category({P1.class})
//    @TestCase
//    @Ignore
//    public void Tc_ChooseCouponAuto_031() {
//        Logger.start(true, "自动选择优惠券--限优选会员+商品-用户是会员（memberGrade=1)-商品与优惠券指定的商品一致-优惠券出现在可用列表中-JIRACONN-32779");
//        try {
//        	CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();
//            String productCode=TestDataManager.getRandomNum(10);
//			// 平台优惠券-链接
//			CreateCouponBean createcouponBean = couponCallService.setDefaultPlatformCreateCouponBeanForRecieve();		
//
//			createcouponBean.getCouponValues().get(0).setOrderMinAmount(new BigDecimal(10));
//            createcouponBean.getCouponValues().get(0).setDeductionMaxAmount(new BigDecimal(9));
//        	createcouponBean.setuseConditionType(13);//12 限优选会员 13 限优选会员+商品
//        	
//		    List<String> list = new ArrayList<String>();
//           // list.add(productCode);
//		    list.add("p11");//与shoppingInfo productCode一致
//	        createcouponBean.setProductIds(list);
//	        Logger.comment("### productCode ### "+productCode);
//
//            // 商家优惠券
//            SellerCreateBatchBean couponBatchBean = couponCallService.setDefaultSellerCreateBatchBean();
//			
//            couponBatchBean.setCouponAmount(new BigDecimal(19));
//            couponBatchBean.setOrderMinAmount(new BigDecimal(20));
//
//            ShoppingInfo shoppingInfo = setChooseCouponAutoBean(createcouponBean, couponBatchBean);
//            
//            shoppingInfo.getBuyerInfo().setMemberGrade(1);
//            shoppingInfo.getAllProducts().get(0).setProductCode("p11");
//            
//            choosecouponautoBean.setShoppingInfo(shoppingInfo);
//
//            choosecouponautoCall.setData(choosecouponautoBean);
//            
//            for(int i=0;i<1;i++)
//            {
//            choosecouponautoCall.callService();
//            }
//
//            verifyReturn(shoppingInfo);
//            
//            
//            long count= choosecouponautoCall.getSellerCouponsList().getSellerCouponsList().get(1).getUsableCoupons().stream()
//            .filter(a->a.getCouponCode().equals(shoppingInfo.getPlatformCouponCode())).count();
//            Logger.comment("条数："+count);
//            Logger.verifyEquals(true, count==1, "商品与优惠券指定的商品一致-优惠券出现在可用列表中");
//            
//
//        } catch (Exception e) {
//            Logger.fail(e);
//        }
//    }
    
    private boolean isCouponContain(List<CouponInfo> coupons, String couponCode)
    {
        for (CouponInfo couponInfo : coupons) {
            if (couponInfo.getCouponCode().equals(couponCode))
            {
                return true;
            }
        }
        return false;
    }

    private ShoppingInfo setChooseCouponAutoBean(CreateCouponBean createcouponBean, SellerCreateBatchBean couponBatchBean)
            throws ClientProtocolException, IOException, InterruptedException
    {
        int userId = Integer.parseInt(EnvSetup.getData("couponBuyerId"));
    	//int userId =Integer.parseInt(TestDataManager.getRandomNum(5));
        CouponShop2cnMCallService couponCallService = new CouponShop2cnMCallService();

        // 平台优惠券
        String platformcouponCode = null;
        if (createcouponBean != null)
        {
            // createcouponBean
            String batchcode2 = couponCallService.createPlatformCoupon(createcouponBean).getBatchCode();
            platformcouponCode = couponCallService.receiveCouponInfo(batchcode2, userId).getUserReceiveResult().getCouponCode();
        }

        // 商家优惠券
        String sellerCouponCode = null;
        ShoppingInfo shoppingInfo;
        if (couponBatchBean != null)
        {
            String batchCode1 = couponCallService.SellerCreateBatch(couponBatchBean).getBatchCode();
            sellerCouponCode = couponCallService.receiveCouponInfo(batchCode1, userId).getUserReceiveResult().getCouponCode();
       
            shoppingInfo =
                    couponCallService.setDefaultShoppingInfo(userId, couponBatchBean.getSellerId(),platformcouponCode, sellerCouponCode);
            
        }
        else {
        	 shoppingInfo =
                     couponCallService.setDefaultShoppingInfo(userId,platformcouponCode, sellerCouponCode);
             
		}

        return shoppingInfo;
    }

    private void verifyReturn(ShoppingInfo shoppingInfo) throws ParseException
    {
        Logger.verifyEquals("0", choosecouponautoCall.getStatusCode1(), "验证返回Code");
        Logger.verifyEquals("操作成功！",
                choosecouponautoCall.getMessage(), "验证返回Message");

        SellerCouponsList sellerCouponsList = choosecouponautoCall.getSellerCouponsList();
        BigDecimal totalPrice = new BigDecimal(0);

        for (SellerCoupons sellerCoupons : sellerCouponsList.getSellerCouponsList()) {
            int sellerId = sellerCoupons.getSellerId();

            CouponInfo bestCouponInfo = sellerCoupons.getBestCoupon();
          List<CouponInfo> usableCoupons = sellerCoupons.getUsableCoupons();
          List<CouponInfo> unUsableCoupons = sellerCoupons.getUnusableCoupons();
            
//            List<CouponInfo> usableCoupons = new ArrayList<CouponInfo>();
//            List<CouponInfo> unUsableCoupons = new ArrayList<CouponInfo>();

            List<SellerOrderInfo> sellerOrderInfoList = shoppingInfo.getSellerOrderInfos();
            List<SellerOrderInfo> sellerOrderInfoList2 =
                    getSellerOrderInfoListBySellerId(sellerId, sellerOrderInfoList);
            BigDecimal amount = getOrderAmount(sellerOrderInfoList2);

            totalPrice = totalPrice.add(amount);
            Date nowDate = new Date();

            if (bestCouponInfo != null)
            {
            	 Map result = new couponWapper().selectCouponInfoByCouponCode(bestCouponInfo.getCouponCode()).get(0);
            	 Logger.verifyEquals(bestCouponInfo.getCouponType(), Integer.parseInt(result.get("CouponType").toString()), "验证couponType");
            	 Logger.verifyEquals(bestCouponInfo.getCouponTypeBizValue(), result.get("CouponTypeBizValue").toString(), "验证CouponTypeBizValue");
            			
                Date startDate1 = YMTDateUtil.getDateFromReturn(bestCouponInfo.getStartTime());
                Date endDate1 = YMTDateUtil.getDateFromReturn(bestCouponInfo.getEndTime());
                Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, startDate1) <= 0, "验证可用优惠券的StartTime大于当前时间");
                Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, endDate1) >= 0, "验证可用优惠券的EndTime小于当前时间");
           	   //神器新增参数
                Logger.verifyEquals(bestCouponInfo.getCurrency(), result.get("Currency").toString(), "验证Currency");
                Logger.verifyEquals(true,bestCouponInfo.getCurrencySymbol().length()>0, "验证CurrencySymbol");
                //验证productIds
                check_productIds( choosecouponautoBean,bestCouponInfo,result);
                // 验证SellerId与买手一致
                if (sellerId != 0)
                {
                  //  Logger.verifyEquals(sellerId, Integer.parseInt(bestCouponInfo.getSellerIds()), "验证返回优惠券SellerId与买手一致");
                    Logger.verifyEquals(sellerId, Integer.parseInt(bestCouponInfo.getSellerId().toString()),
                            "验证返回优惠券SellerId与买手一致");
                }
                else {
                    Logger.verifyEquals(0, Integer.parseInt(bestCouponInfo.getSellerId().toString()), "验证返回优惠券SellerId与买手一致");
                }

                for (CouponInfo couponInfo : usableCoupons) {
                    // 验证SellerId与买手一致
                	if(sellerId!=0)
                     Logger.verifyEquals(sellerId, Integer.parseInt(couponInfo.getSellerIds()), "验证返回优惠券SellerId与买手一致");
                    // 验证时间有效
                    Date startDate = YMTDateUtil.getDateFromReturn(couponInfo.getStartTime());
                    Date endDate = YMTDateUtil.getDateFromReturn(couponInfo.getEndTime());
                    
                    Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, startDate1) <= 0, "验证可用优惠券的StartTime大于当前时间");
                    Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, endDate1) >= 0, "验证可用优惠券的EndTime小于当前时间");
                 
                    Map result1 = new couponWapper().selectCouponInfoByCouponCode(couponInfo.getCouponCode()).get(0);
//                	Logger.verifyEquals(Integer.parseInt(result.get("iScenarioType").toString()), couponInfo.getProductLimitType(),
//            				"验证返回字段productLimitType与Ymt_CouponSetting表中iScenarioType一致");
                	 Logger.verifyEquals(couponInfo.getCouponType(), Integer.parseInt(result1.get("CouponType").toString()), "验证couponType");
                   	 Logger.verifyEquals(couponInfo.getCouponTypeBizValue(), result1.get("CouponTypeBizValue").toString(), "验证CouponTypeBizValue");
                    ///////////////////////////////////////////////////
                 	   //神器新增参数
                     Logger.verifyEquals(couponInfo.getCurrency(), result1.get("Currency").toString(), "验证Currency");
                     Logger.verifyEquals(true,couponInfo.getCurrencySymbol().length()>0, "验证CurrencySymbol");
                     //验证productIds
                     check_productIds( choosecouponautoBean,couponInfo,result1);
                     
                    if (sellerId != 0)
                    {
                        // 验证MeetAmount大于订单金额
                        Logger.verifyEquals(true, couponInfo.getMeetAmount().compareTo(amount) <= 0,
                                "验证优惠券使用订单金额小于该seller订单金额");

                        // 验证DeductionAmount小于最优优惠券金额
                        Logger.verifyEquals(true, couponInfo.getDeductionAmount()
                                .compareTo(bestCouponInfo.getDeductionAmount()) <= 0, "验证优惠券使用订单金额小于该seller最优优惠券金额");
                    }
//                    else {
//                        Logger.verifyEquals(true, couponInfo.getMeetAmount().compareTo(totalPrice) <= 0,
//                                "验证优惠券使用订单金额小于订单总金额");
//
//                        // 验证DeductionAmount小于最优优惠券金额
//                        Logger.verifyEquals(true, couponInfo.getDeductionAmount()
//                                .compareTo(bestCouponInfo.getDeductionAmount()) <= 0, "验证优惠券使用订单金额小于该平台最优优惠券金额");
//                    }
                }
            }

            for (CouponInfo couponInfo : unUsableCoupons) {
            	 Map result2 = new couponWapper().selectCouponInfoByCouponCode(couponInfo.getCouponCode()).get(0);
               	 Logger.verifyEquals(couponInfo.getCouponType(), Integer.parseInt(result2.get("CouponType").toString()), "验证couponType");
               	 Logger.verifyEquals(couponInfo.getCouponTypeBizValue(), result2.get("CouponTypeBizValue").toString(), "验证CouponTypeBizValue");
               	 
                // 验证时间有效
//                Date startDate = YMTDateUtil.getDateFromReturn(couponInfo.getStartTime());
//                Date endDate = YMTDateUtil.getDateFromReturn(couponInfo.getEndTime());
//                Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, startDate) <= 0, "验证可用优惠券的StartTime小于当前时间");
//                Logger.verifyEquals(true, YMTDateUtil.diffSecond(nowDate, endDate) >= 0, "验证可用优惠券的EndTime大于当前时间");

                // 验证当前买手购物车是否最优项目是false
              //  Logger.verifyEquals(false, couponInfo.isIsBestShopping(), "验证当前买手购物车是否最优项是false");

               // Logger.verifyEquals(true, couponInfo.getMeetAmount().compareTo(amount) > 0, "验证优惠券使用订单金额小于该seller订单金额");
            }
        }
    }

    List<SellerOrderInfo> getSellerOrderInfoListBySellerId(int sellerId, List<SellerOrderInfo> sellerOrderInfoList)
    {
        List<SellerOrderInfo> sellerOrderInfoList2 = new ArrayList<SellerOrderInfo>();
        for (SellerOrderInfo sellerOrderInfo : sellerOrderInfoList) {
            if (sellerOrderInfo.getSellerId() == sellerId)
            {
                sellerOrderInfoList2.add(sellerOrderInfo);
            }
        }
        return sellerOrderInfoList2;
    }

    BigDecimal getOrderAmount(List<SellerOrderInfo> sellerOrderInfoList)
    {
        BigDecimal amount = new BigDecimal(0);
        for (SellerOrderInfo sellerOrderInfo : sellerOrderInfoList) {
            for (OrderInfo orderInfo : sellerOrderInfo.getOrderInfos()) {
                for (ProductInfo productInfo : orderInfo.getProductInfos()) {
                    BigDecimal priceBigDecimal =
                            productInfo.getProductPrice().multiply(new BigDecimal(productInfo.getProductQuantity()));
                    amount = amount.add(priceBigDecimal);
                }
            }
        }
        return amount;
    }
    
    /**
     * 
     * @param choosecouponautoBean
     * @param retrun_CouponInfo 接口返回的info
     * @param result1 数据库查询的结果集
     */
    private void check_productIds(ChooseCouponAutoBean choosecouponautoBean,CouponInfo retrun_CouponInfo,Map result1){
    	 //神器新增参数
//        Logger.verifyEquals(retrun_CouponInfo.getCurrency(), result1.get("Currency").toString(), "验证Currency");
//        Logger.verifyEquals(true,retrun_CouponInfo.getCurrencySymbol().length()>0, "验证CurrencySymbol");
       //productIds
       //购物车
       List<String> productIds =choosecouponautoBean.getShoppingInfo().getSellerOrderInfos().get(0).getOrderInfos().get(0).getProductInfos().stream().map(a->a.getProductCode()).collect(Collectors.toList());
       if(Integer.parseInt(result1.get("UseConditionType").toString())==1)
       {
       	Logger.comment("#########  bathid 1 #############"+retrun_CouponInfo.getBatchId());
       	//返回
       	for(int i=0;i<productIds.size();i++)
       	{
       		Logger.verifyEquals(true,retrun_CouponInfo.getProductIds().contains(productIds.get(i)), "验证优惠券通用时，返回productIds包含购物车中的商品");
       	}
       }
       else if(Integer.parseInt(result1.get("UseConditionType").toString())==2)
       {
         Logger.comment("#########  bathid 2 #############"+retrun_CouponInfo.getBatchId());
             //数据库当前优惠券适配商品
            couponuseconditionWapper couponuseconditionWapper=new couponuseconditionWapper();
            List<String> conditionValuesList=couponuseconditionWapper.selectByConditionTypeAndBatchId(retrun_CouponInfo.getBatchId(), 2).stream().map(a->a.getConditionValue()).collect(Collectors.toList());
            List<String> newIds=new ArrayList();
            //返回
	       	for(int i=0;i<productIds.size();i++)
	       	 {
	       		if(conditionValuesList.contains(productIds.get(i)))
	       		{
	       			newIds.add(productIds.get(i));
	       			Logger.verifyEquals(true,retrun_CouponInfo.getProductIds().contains(productIds.get(i)), "验证优惠券指定商品时，返回productIds包含购物车中的商品");
	       		}
	       	 }
	       	 Logger.verifyEquals(retrun_CouponInfo.getProductIds().size(), newIds.size(), "返回适配的与购物车匹配的一致");
	       }
	       // 验证当前买手购物车是否最优项目是false
	       Logger.verifyEquals(false, retrun_CouponInfo.isIsBestShopping(), "验证当前买手购物车是否最优项是false");
    }
}
